﻿/************************************************************************/
/* FileName:        GCFont
 * Author:          Aric.W
 * Created:         2013/9/17 16:15:25
 * Version:         A001
 * Compiler:        Visual Studio 2010
 * Description:     字体
 * 
 * History:
 * <Author>         <Time>              <Version>   <Desc>
 * Aric.W           2013/9/17 16:15:25  A001        create
/************************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Common
{
    /// <summary>
    /// 字体
    /// </summary>
    public struct GCFont
    {
        /// <summary>
        /// 字形
        /// </summary>
        private GCFontStyle style;

        public GCFontStyle Style
        {
            get { return style; }
            set { style = value; }
        }

        /// <summary>
        /// 字体名称
        /// </summary>

        private string name;

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        /// <summary>
        /// 字体大小
        /// </summary>
        private float size;

        public float Size
        {
            get { return size; }
            set { size = value; }
        }

        /// <summary>
        /// 字符串对其方式
        /// </summary>
        private GCStringAlignment stringAlignment;
        public GCStringAlignment StringAlignment
        {
            get { return stringAlignment; }
            set { stringAlignment = value; }
        }

        /// <summary>
        /// 字体颜色
        /// </summary>
        private GCColor color;

        public GCColor Color
        {
            get { return color; }
            set { color = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="name">字体名称</param>
        /// <param name="size">字号</param>
        public GCFont(string name, float size)
        {
            this.name = name;
            this.size = size;
            this.style = GCFontStyle.Regular;
            this.color = new GCColor(255, 0, 0, 0);
            this.stringAlignment = GCStringAlignment.Left;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public Font GetFont()
        {
            return new Font(name, size, (FontStyle)style, GraphicsUnit.Point);
        }

    }//end GCFont
}
